By scanning through the elements of the array, updating a provisional maximum until the last element is reached.
This is the same algorithm that was used in the previous chapter.
Now it will be implemented as a method.
Here is a partial definition of the ArrayOps
class.
The ArrayOps
class contains a method findMax()
that
finds the maximum of an array.
The parameter list is of the method is: int[] x
x
which will be a
reference to an array object.x
to
stand for the actual array it will work with.
The parameter x
means
"whatever data is supplied when the method
starts to run."
This might be different data at different times.
Fill in the blank so that the method is complete.